package com.test.ai.config;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created with IntelliJ IDEA.
 *
 * @description:
 * @author: liuziyang
 * @since: 8/21/25 11:40 AM
 * @modifiedBy:
 * @version: 1.0
 */
@Configuration
public class OllamaAiConfig {
  @Bean("ollamaChatClient")
  public ChatClient ollamaChatClient(@Qualifier("ollamaChatModel") ChatModel ollamaChatModel) {
    // 使用 Ollama 的 ChatModel 构建 ChatClient（具体构造方式依赖 Spring AI 版本）
    return ChatClient.builder(ollamaChatModel).build();
  }
}
